
<!DOCTYPE html>
<html lang="">


<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
  <meta name="theme-color" content="#202020">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <script src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>
  
  
    <meta name="keywords" content>
  

  
    <meta name="description" content="复制粘贴工程师,">
  
  
  <link rel="icon" type="image/x-icon" href="/logo.png">
  <title>archives: 2/2019: 2019 [ 复制粘贴工程师 ]</title>
  
    <!-- stylesheets list from config.yml -->
    
      <link rel="stylesheet" href="//cdn.bootcss.com/pure/1.0.0/pure-min.css">
    
      <link rel="stylesheet" href="/css/xoxo.css">
    
  
</head>


<body>
  <div class="nav-container">
    <nav class="home-menu pure-menu pure-menu-horizontal">
  <a class="pure-menu-heading" href="/">
    <img class="avatar" src="https://wx.qlogo.cn/mmopen/vi_32/AMpRacDgkTPogKk4gQ5IC3QezP55XoPpicQpnD9Vz3eNz6OPFYyFrFzCa4EGQGH65kPia5YJwQBBvvJpVwQ4lfVg/132">
    <span class="title">复制粘贴工程师</span>
  </a>

  <ul class="pure-menu-list clearfix">
      
          
            <li class="pure-menu-item"><a href="/" class="pure-menu-link">首页</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/search" class="pure-menu-link">搜索</a></li>
          
      
  </ul>

</nav>
  </div>

  <div class="container" id="content-outer">
    <div class="inner" id="content-inner">
      

  
  
    
    
    <section class="post page archives">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/微信小程序/">微信小程序</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Javascript/">Javascript</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Github/">Github</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/SPA/">SPA</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/增量检查/">增量检查</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/eslint/">eslint</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/eslint-staged/">eslint-staged</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Resultful/">Resultful</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/SSR/">SSR</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/oh-my-zsh/">oh-my-zsh</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hooks/">hooks</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Github钩子/">Github钩子</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Pub-Sub/">Pub/Sub</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/状态管理/">状态管理</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JQuery/">JQuery</a><span class="tag-list-count">1</span></li></ul>
      <h3 class="archive-year-wrap">
        <a href="/archives/2019" class="archive-year">
          2019
        </a>
      </h3>
      <div class="archives">
  
  <div class="archive">
  <a class="post-go" href="/2019/02/28/Javascript代码检查那点事/">
    <div class="post-go-item">
      <span class="date">
        02-28
      </span>
      <span class="slash">/</span>
      Javascript代码检查那点事
      
        <ul class="index-tag-list"><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/Javascript/">Javascript</a></li><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/eslint/">eslint</a></li><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/eslint-staged/">eslint-staged</a></li><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/增量检查/">增量检查</a></li></ul>
      
    </div>

    <!--<div class="excerpt">-->
      <!--<blockquote>
<p>一时不做规范一时爽，一直不做规范一直爽。阿呸，代码规范这事，可小可大，如果一个项目长期没有规范检查，那么随着参与人数和代码量的增加，就会存在很多的潜在地雷，随时可能爆炸！本文将介绍如何安装和使用 <code>EditorConfig</code>、 <code>eslint</code> 、 <code>eslint staged</code>，从而实现 <code>Javascript</code> 代码的增量检查。<br>-->
    <!--</div>-->
  </a>

</div>

<style lang="less">
.archive .index-tag-list {
  font-size: 13px;
  display: inline;
  padding: 0;
}
.archive .index-tag-list .index-tag-list-item {
  margin-right: 5px;
  /*color: #999;*/
  padding: 2px 5px;
  /*background-color: #f6f6f6;*/
  border-radius: 2px;
  display: inline;
  list-style: none;
  /*background: #DDDDDD;*/
  background: #28a745;
  color: #FFFFFF;
  font-weight: bold;
}
.archive .index-tag-list .index-tag-list-item:hover {
  background-color: #efefef;
}
.post-go-item {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}
.archive .slash {
  color: #000000;
}
.archives .archive .date {
  color: #000000;
  font-weight: bold;
}
</style>

  
  
  <div class="archive">
  <a class="post-go" href="/2019/02/28/Oh-my-zsh/">
    <div class="post-go-item">
      <span class="date">
        02-28
      </span>
      <span class="slash">/</span>
      Oh-my-zsh
      
        <ul class="index-tag-list"><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/oh-my-zsh/">oh-my-zsh</a></li></ul>
      
    </div>

    <!--<div class="excerpt">-->
      <!--<p><code>zsh</code> 是一个虚拟终端，原先不同的终端有不同的命令，现在通过这个虚拟终端就可以执行所有的命令，如可以执行git命令、subline命令等。本文将介绍 <code>zsh</code> 在 <code>mac</code> 中的安装和使用。</p>-->
    <!--</div>-->
  </a>

</div>

<style lang="less">
.archive .index-tag-list {
  font-size: 13px;
  display: inline;
  padding: 0;
}
.archive .index-tag-list .index-tag-list-item {
  margin-right: 5px;
  /*color: #999;*/
  padding: 2px 5px;
  /*background-color: #f6f6f6;*/
  border-radius: 2px;
  display: inline;
  list-style: none;
  /*background: #DDDDDD;*/
  background: #28a745;
  color: #FFFFFF;
  font-weight: bold;
}
.archive .index-tag-list .index-tag-list-item:hover {
  background-color: #efefef;
}
.post-go-item {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}
.archive .slash {
  color: #000000;
}
.archives .archive .date {
  color: #000000;
  font-weight: bold;
}
</style>

  
  
  <div class="archive">
  <a class="post-go" href="/2019/02/28/Github小白指南/">
    <div class="post-go-item">
      <span class="date">
        02-28
      </span>
      <span class="slash">/</span>
      Github小白指南
      
        <ul class="index-tag-list"><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/Github/">Github</a></li></ul>
      
    </div>

    <!--<div class="excerpt">-->
      <!--<p>咳咳，有如此完美的可视化界面不用，偏偏要用命令行，何必呢！命令行这东西，按需获取，当你遇到需要完成的操作无从下手时，可以过来看看，没必要全部记下来。<br>-->
    <!--</div>-->
  </a>

</div>

<style lang="less">
.archive .index-tag-list {
  font-size: 13px;
  display: inline;
  padding: 0;
}
.archive .index-tag-list .index-tag-list-item {
  margin-right: 5px;
  /*color: #999;*/
  padding: 2px 5px;
  /*background-color: #f6f6f6;*/
  border-radius: 2px;
  display: inline;
  list-style: none;
  /*background: #DDDDDD;*/
  background: #28a745;
  color: #FFFFFF;
  font-weight: bold;
}
.archive .index-tag-list .index-tag-list-item:hover {
  background-color: #efefef;
}
.post-go-item {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}
.archive .slash {
  color: #000000;
}
.archives .archive .date {
  color: #000000;
  font-weight: bold;
}
</style>

  
  
  <div class="archive">
  <a class="post-go" href="/2019/02/20/深入理解JQuery原理/">
    <div class="post-go-item">
      <span class="date">
        02-20
      </span>
      <span class="slash">/</span>
      深入理解JQuery原理
      
        <ul class="index-tag-list"><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/JQuery/">JQuery</a></li><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/Javascript/">Javascript</a></li></ul>
      
    </div>

    <!--<div class="excerpt">-->
      <!--<p>本文将手把手逐渐实现一个简化版的 <code>JQuery</code>。</p>
<h3 id="先来自己动手简化选择器"><a href="#先来自己动手简化选择器" class="headerlink" title="先来自己动手简化选择器"></a>先来自己动手简化选择器</h3><p><code>base</code> 是一个对象，拥有两个方法，方法名为 <code>$</code>、<code>$$</code>，功能分别为通过 <code>id</code> 和 <code>class</code> 来获取元素。</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> base = &#123;</span><br><span class="line">    $:<span class="function"><span class="keyword">function</span>(<span class="params">id</span>)</span>&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="built_in">document</span>.getElementById(id);</span><br><span class="line">    &#125;,</span><br><span class="line">    $$:<span class="function"><span class="keyword">function</span>(<span class="params">className</span>)</span>&#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="built_in">document</span>.getElementsByClassName(className);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">//使用</span></span><br><span class="line">base.$(<span class="string">"id"</span>);       <span class="comment">//返回相应的元素对象</span></span><br><span class="line">base.$$(<span class="string">"class"</span>);   <span class="comment">//返回相应的元素对象集合</span></span><br></pre></td></tr></table></figure>-->
    <!--</div>-->
  </a>

</div>

<style lang="less">
.archive .index-tag-list {
  font-size: 13px;
  display: inline;
  padding: 0;
}
.archive .index-tag-list .index-tag-list-item {
  margin-right: 5px;
  /*color: #999;*/
  padding: 2px 5px;
  /*background-color: #f6f6f6;*/
  border-radius: 2px;
  display: inline;
  list-style: none;
  /*background: #DDDDDD;*/
  background: #28a745;
  color: #FFFFFF;
  font-weight: bold;
}
.archive .index-tag-list .index-tag-list-item:hover {
  background-color: #efefef;
}
.post-go-item {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}
.archive .slash {
  color: #000000;
}
.archives .archive .date {
  color: #000000;
  font-weight: bold;
}
</style>

  
  
  <div class="archive">
  <a class="post-go" href="/2019/02/20/Javascript内存结构分析/">
    <div class="post-go-item">
      <span class="date">
        02-20
      </span>
      <span class="slash">/</span>
      Javascript内存结构分析
      
        <ul class="index-tag-list"><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/Javascript/">Javascript</a></li></ul>
      
    </div>

    <!--<div class="excerpt">-->
      <!--<p>虽然很少触及，但是网页也是有内存上限的，当 <code>html</code>、<code>javascript</code>等数据大小超过上限时，浏览器可能会闪退或停止响应。本文将介绍网页的内存结构、Javascript 垃圾回收机制以及函数闭包。<br>-->
    <!--</div>-->
  </a>

</div>

<style lang="less">
.archive .index-tag-list {
  font-size: 13px;
  display: inline;
  padding: 0;
}
.archive .index-tag-list .index-tag-list-item {
  margin-right: 5px;
  /*color: #999;*/
  padding: 2px 5px;
  /*background-color: #f6f6f6;*/
  border-radius: 2px;
  display: inline;
  list-style: none;
  /*background: #DDDDDD;*/
  background: #28a745;
  color: #FFFFFF;
  font-weight: bold;
}
.archive .index-tag-list .index-tag-list-item:hover {
  background-color: #efefef;
}
.post-go-item {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}
.archive .slash {
  color: #000000;
}
.archives .archive .date {
  color: #000000;
  font-weight: bold;
}
</style>

  
  
  <div class="archive">
  <a class="post-go" href="/2019/02/19/5分钟搞定个人博客/">
    <div class="post-go-item">
      <span class="date">
        02-19
      </span>
      <span class="slash">/</span>
      5分钟搞定个人博客
      
        <ul class="index-tag-list"><li class="index-tag-list-item"><a class="index-tag-list-link" href="/tags/hexo/">hexo</a></li></ul>
      
    </div>

    <!--<div class="excerpt">-->
      <!--<p>民间有传言，没有手撸过个人网站的程序员不是一个好的前端开发工程师，可是！强撸灰飞湮灭！为了自己的身体健康，还是少撸为妙！不要998，也不要98，完全免费，<a href="https://hexo.io/zh-cn/" target="_blank" rel="noopener">hexo</a>你直接带回家。通过hexo，可以快速构建个人博客，并搭建到 <code>github</code> 上供他人访问，三秒真男人，我们开始吧！</p>-->
    <!--</div>-->
  </a>

</div>

<style lang="less">
.archive .index-tag-list {
  font-size: 13px;
  display: inline;
  padding: 0;
}
.archive .index-tag-list .index-tag-list-item {
  margin-right: 5px;
  /*color: #999;*/
  padding: 2px 5px;
  /*background-color: #f6f6f6;*/
  border-radius: 2px;
  display: inline;
  list-style: none;
  /*background: #DDDDDD;*/
  background: #28a745;
  color: #FFFFFF;
  font-weight: bold;
}
.archive .index-tag-list .index-tag-list-item:hover {
  background-color: #efefef;
}
.post-go-item {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}
.archive .slash {
  color: #000000;
}
.archives .archive .date {
  color: #000000;
  font-weight: bold;
}
</style>


  </div></section>

    </div>

    
    <div id="vcomments" style="max-width: 800px; margin: 16px auto;"></div>
  </div>
  <footer class="footer text-center">
    <div id="bottom-inner">
        <a class="bottom-item" href="/">首页</a> |
        <a class="bottom-item" href="https://github.com/TJ-XiaJiaHao" target="_blank">GitHub</a> |
        <a class="bottom-item">联系邮箱：1452806@tongji.edu.cn</a>
    </div>
</footer>
  

<script>
  (function(window, document, undefined) {

    var timer = null;

    function returnTop() {
      cancelAnimationFrame(timer);
      timer = requestAnimationFrame(function fn() {
        var oTop = document.body.scrollTop || document.documentElement.scrollTop;
        if (oTop > 0) {
          document.body.scrollTop = document.documentElement.scrollTop = oTop - 50;
          timer = requestAnimationFrame(fn);
        } else {
          cancelAnimationFrame(timer);
        }
      });
    }

    var hearts = [];
    window.requestAnimationFrame = (function() {
      return window.requestAnimationFrame ||
        window.webkitRequestAnimationFrame ||
        window.mozRequestAnimationFrame ||
        window.oRequestAnimationFrame ||
        window.msRequestAnimationFrame ||
        function(callback) {
          setTimeout(callback, 1000 / 60);
        }
    })();
    init();

    function init() {
      css(".heart{z-index:9999;width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: absolute;}.heart:after{top: -5px;}.heart:before{left: -5px;}");
      attachEvent();
      gameloop();
      addMenuEvent();
    }

    function gameloop() {
      for (var i = 0; i < hearts.length; i++) {
        if (hearts[i].alpha <= 0) {
          document.body.removeChild(hearts[i].el);
          hearts.splice(i, 1);
          continue;
        }
        hearts[i].y--;
        hearts[i].scale += 0.004;
        hearts[i].alpha -= 0.013;
        hearts[i].el.style.cssText = "left:" + hearts[i].x + "px;top:" + hearts[i].y + "px;opacity:" + hearts[i].alpha + ";transform:scale(" + hearts[i].scale + "," + hearts[i].scale + ") rotate(45deg);background:" + hearts[i].color;
      }
      requestAnimationFrame(gameloop);
    }

    /**
     * 给logo设置点击事件
     * 
     * - 回到顶部
     * - 出现爱心
     */
    function attachEvent() {
      var old = typeof window.onclick === "function" && window.onclick;
      var logo = document.getElementById("logo");
      if (logo) {
        logo.onclick = function(event) {
          returnTop();
          old && old();
          createHeart(event);
        }
      }
      
    }

    function createHeart(event) {
      var d = document.createElement("div");
      d.className = "heart";
      hearts.push({
        el: d,
        x: event.clientX - 5,
        y: event.clientY - 5,
        scale: 1,
        alpha: 1,
        color: randomColor()
      });
      document.body.appendChild(d);
    }

    function css(css) {
      var style = document.createElement("style");
      style.type = "text/css";
      try {
        style.appendChild(document.createTextNode(css));
      } catch (ex) {
        style.styleSheet.cssText = css;
      }
      document.getElementsByTagName('head')[0].appendChild(style);
    }

    function randomColor() {
      // return "rgb(" + (~~(Math.random() * 255)) + "," + (~~(Math.random() * 255)) + "," + (~~(Math.random() * 255)) + ")";
      return "#F44336";
    }

    function addMenuEvent() {
      var menu = document.getElementById('menu-main-post');
      if (menu) {
        var toc = document.getElementById('toc');
        if (toc) {
          menu.onclick = function() {
            if (toc) {
              if (toc.style.display == 'block') {
                toc.style.display = 'none';
              } else {
                toc.style.display = 'block';
              }
            }
          };
        } else {
          menu.style.display = 'none';
        }
      }
    }

  })(window, document);
</script>

  



</body>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<script type="text/javascript">
  new Valine({
    el: '#vcomments',
    appId: '8CwYqXS8IoFbvaA9PmgqGjTf-gzGzoHsz',
    appKey: 'z5bVoSPDPhd8hzlXvDey5Hpz',
    verify:false,
    placeholder: '评论留言'
  })
</script>
</html>
